import com.learn.config.TaskExecutorConfig;
import com.learn.taskexecutor.AsyncTaskService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by xuxiaobao on 2017/8/1.
 */
public class TaskExecutorMain {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(TaskExecutorConfig.class);

        AsyncTaskService taskService = context.getBean(AsyncTaskService.class);

        for (int i=0; i<10; i++) {
            taskService.executeAsyncTask(i);
            taskService.executeAsyncTaskPlus(i+1);
        }

        context.close();
    }
}
